#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
from Util.handle_json import read_json
import sys
import os
base_path = os.path.abspath(os.path.join(os.getcwd(), ".."))  # 获取上级目录
sys.path.append(base_path)


def get_header():
    data = read_json("/Config/header.json")
    return data


def header_md5():
    '''

    '''

    data = get_header()
    key = data['imooc_key']


# MD5加密封装类
# class HandleHeader:
#     def read_hearder_data(self):
#         data = read_json("/Config/header.json")
#         return data
#
#     def get_header_data(self,key):
#         data = self.read_hearder_data()
#         return data[key]
#     def haader_md5(self,key,code):
#         data =self.get_header_data(key)
#         value = data[code]
#         print(value)
#         md5 = hashlib.md5()
#         md5.update(value.encode("utf-8"))
#         res = md5.hexdigest()
#         data[code] = res
#         return data
